package com.sinosoft.ebusiness.annotation;

import java.lang.annotation.*;
import java.util.concurrent.TimeUnit;

@Target({ElementType.METHOD})
@Retention(RetentionPolicy.RUNTIME)
@Inherited
@Documented
public  @interface CacheAnnotation {

    /**
     * The cache key.
     *
     * @return
     */
    String key() default "";

    /**
     * The cache timeout, unit for seconds.
     * @return
     */
    int timeout() default 30;

    /**
     * The cahce time ,unit
     * @return
     */
    TimeUnit unit() default TimeUnit.SECONDS;

    /**
     * Whether serialize the cache object.
     *
     * @return
     */
    boolean serialize() default false;

}
